import request from "../../api/request";
const market = "market";

// 获取表单数据
export function listByPage(data) {
  return request({
    url: market + "/billGroup/listByPage",
    method: "post",
    data: data || {}
  });
}
// 新增数据
export function save(data) {
  return request({
    url: market + "/billGroup/save",
    method: "post",
    data: data || {}
  });
}
// 修改数据
export function update(data) {
  return request({
    url: market + "/billGroup/update",
    method: "post",
    data: data || {}
  });
}
// 删除接口（包含批量删除）
export function remove(params) {
  return request({
    url: market + "/billGroup/remove",
    method: "delete",
    data: params
  });
}

// 获取组织机构树
export function getPowerOrgTree(id) {
  return request({
    url: market + `/billGroup/getPowerOrgTree/${id}`,
    method: "get",
  });
}
// 获取充电站(包含 已选和未选 )
export function getStaByOrgIds(data) {
  return request({
    url: market + "/billGroup/getStaByOrgIds",
    method: "post",
    data: data || {}
  });
}
// 获取充电桩
export function getAssetDevList(data) {
  return request({
    url: market + "/billGroup/getAssetDevList"+data,
    method: "post",
    // data: data || {}
  });
}

// 制定--保存
export function saveAllBillBgroup(data) {
  return request({
    url: market + "/billGroup/saveAllBillBgroup",
    method: "post",
    data: data || {}
  });
}
// 制定--修改保存
export function updateAllBillBgroup(data) {
  return request({
    url: market + "/billGroup/updateAllBillBgroup",
    method: "post",
    data: data || {}
  });
}
// 制定--获取修改已选的组织机构
export function getGroupDevById(data) {
  return request({
    url: market + "/billGroup/getGroupDevById",
    method: "get",
    params: data || {}
  });
}

// 制定--获取修改已选的充电桩的数量
export function getGroupAssetDevList(data) {
  return request({
    url: market + "/billGroup/getGroupAssetDevList"+data,
    method: "post"
  });
}
// 制定获取已选的站和已选桩
export function getDevById(id) {
  return request({
    url: market + `/billGroup/getDevById/${id}`,
    method: "get",
  });
}

// 计费模型模型接口
export function listBillModelByStaus(data) {
  return request({
    url: market + "/billModel/listBillModelByStaus",
    method: "post",
    data: data || {}
  });
}

// 制定卡表单数据接口获取
export function getCardByOrgIds(data) {
  return request({
    url: market + "/card/getCardByOrgIds",
    method: "post",
    data: data || {}
  });
}

// 保存 --- 卡数据
export function saveGroup(data) {
  return request({
    url: market + "/card/saveGroup",
    method: "post",
    data: data || {}
  });
}

// 查看卡已经操作的详情
export function getGroupCardById(data) {
  return request({
    url: market + "/card/getGroupCardById",
    method: "get",
    params: data || {}
  });
}

// 卡修改保存接口
export function updateGroup(data) {
  return request({
    url: market + "/card/updateGroup",
    method: "post",
    data: data || {}
  });
}